const reactRouter = require('../utils/react-navigation');

class RnRouter {
    forward = options => {
        if (options.url.indexOf('http') != 0) {
            options.url = `${location.origin}/rapp/festival/#${options.url}`;
        }
        // console.log('准备跳转', options);
        return routerRn('forward', options);
    };
    back = options => {
        return routerRn('back', {
            step: options || 1
        });
    };
    redirect = options => {
        if (options.url.indexOf('http') < 0) {
            options.url = `${location.origin}/rapp/festival/#${options.url}`;
        }
        console.log('准备重定向跳转', options);
        location.href = options.url;
        // routerRn('back', {
        //     step: 1
        // });
        // routerRn('forward', options);
        header({
            title: options.title
        });
    };
}
